package org.yray.ufiletools.file;

import sun.misc.Unsafe;

import java.util.concurrent.atomic.AtomicInteger;

public class TestA {
    private volatile int value;
    public TestA(int v)
    {
        value=v;
    }
    public static void main(String[] args) throws Exception{
        AtomicInteger integer=new AtomicInteger(1);
        int s=integer.getAndIncrement();
        System.out.println(s);
        TestA testA=new TestA(3);
        int a=Unsafe.getUnsafe().getAndAddInt(testA,Unsafe.getUnsafe().objectFieldOffset(TestA.class.getDeclaredField("value")),1);
        System.out.println(a);

    }
}
